package com.heima.pro_system;

public class Goods extends Product {
    //打折
    private double discount;

    public Goods(double discount) {
        this.discount = discount;
    }

    public Goods(String name, double price, double discount) {
        super(name, price);
        this.discount = discount;
    }

    public double getDiscount() {
        return discount;
    }

    public void setDiscount(double discount) {
        this.discount = discount;
    }

    @Override
    public void calculateDiscount() {
        System.out.println(getName() + "商品今日打" + getDiscount() + "折,打折后的价格为:" + getPrice() * getDiscount() * 0.1);

    }
}
